package com.papper.mng.domain.nav;

import com.alibaba.fastjson.annotation.JSONField;
import tk.mybatis.mapper.util.StringUtil;

import java.util.List;

/**
 * @author:LaJiao
 * @date 2022年03月23日
 * @time 11时48
 * @Description:导航对象
 */
public class NavBo {
    // 自定义Id
    @JSONField(serialize = false)
    private Integer     id;
    // 父类ID
    @JSONField(serialize = false)
    private Integer     upId;
    // 导航标题
    private String      title      = "";
    // 指向的页面路径
    private String      href       = "";
    // 标题的字体图标来源
    private String      fontFamily = "layui-icon";
    // 制定字体图标
    private String      icon       = "&#xe62e;";
    // 设置导航页是否关闭
    private Boolean     isClose;
    // 设置是否打开
    private Boolean     spread     = false;
    // 是否选中
    private Boolean     isCheck;
    // 子导航
    private List<NavBo> children;

    public NavBo(Integer id, Integer upId, String title, String href, String icon) {
        this.title = title;
        this.href = href;
        this.id = id;
        this.upId = upId;
        if (!StringUtil.isEmpty(icon) && icon.startsWith("layui-icon")) {
            this.icon = icon;
        } else if (!StringUtil.isEmpty(icon) && icon.startsWith("fa")) {
            this.icon = icon;
        }
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getHref() {
        return href;
    }

    public void setHref(String href) {
        this.href = href;
    }

    public String getFontFamily() {
        return fontFamily;
    }

    public void setFontFamily(String fontFamily) {
        this.fontFamily = fontFamily;
    }

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }

    public Boolean getClose() {
        return isClose;
    }

    public void setClose(Boolean close) {
        isClose = close;
    }

    public Boolean getSpread() {
        return spread;
    }

    public void setSpread(Boolean spread) {
        this.spread = spread;
    }

    public Boolean getCheck() {
        return isCheck;
    }

    public void setCheck(Boolean check) {
        isCheck = check;
    }

    public List<NavBo> getChildren() {
        return children;
    }

    public void setChildren(List<NavBo> children) {
        this.children = children;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getUpId() {
        return upId;
    }

    public void setUpId(Integer upId) {
        this.upId = upId;
    }
}
